﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TMI85303.UI.Messages
{
    public enum MesgToken
    {
        DEFAULT = 0,

        /// <summary>
        /// MTPdata 界面模型
        /// </summary>
        MTP_DATA,

        /// <summary>
        /// 寄存器模型
        /// </summary>
        RegVMToken,

        /// <summary>
        /// 主界面
        /// </summary>
        MainWindowToken,

        /// <summary>
        /// 寄存器166界面
        /// </summary>
        Reg166Token,

        /// <summary>
        /// 实时速度曲线界面
        /// </summary>
        SpeedPlotWinToken,

    }

    /// <summary>
    /// 从文件读取MTPData配置
    /// </summary>
    public record ReadFileMTPDataConfig() { }

    /// <summary>
    /// 把数据写到文件中去
    /// </summary>
    public record WriteFileMTPDataConfig() { }

    /// <summary>
    /// 读取所有的MTP数据
    /// </summary>
    public record ReadAllMTPMesg() { }

    /// <summary>
    /// 写所有的MTP数据
    /// </summary>
    public record WriteAllMTPMesg() { }

    /// <summary>
    /// 速度曲线图刷新
    /// </summary>
    public record RefreshSpeedCurveMesg() { }

    /// <summary>
    /// 实时速度界面关闭
    /// </summary>
    /// <param name="NewSpeed"></param>
    public record SpeedPlotClosedMesg() { }

    /// <summary>
    /// 按照总数为32个寄存器的版本，根据寄存器的下标和新值，更新绑定位置的寄存器的值
    /// </summary>
    /// <param name="Index32Reg"></param>
    /// <param name="NewData"></param>
    public record UpdateRegisterMesg(int Index32Reg,int NewData);

    /// <summary>
    /// 任何发送的数据（具体控件触发或MTP界面）都会在MTP数据界面进行更新
    /// </summary>
    /// <param name="Index32Reg"></param>
    /// <param name="NewData"></param>
    public record UpdateMTPDataMesg(int Index32Reg,int NewData);

    /// <summary>
    /// 位于主界面的RPM信息的显示与否
    /// </summary>
    /// <param name="Visible"></param>
    public record RPMInfoVisibleMesg(bool Visible);

    /// <summary>
    /// 更新主界面RPM FG Felec等信息
    /// </summary>
    /// <param name="Info"></param>
    public record UpdateRPMInfoMesg(string Info);

    /// <summary>
    /// 更新第几个寄存器的第几位
    /// </summary>
    /// <param name="RegIndex"></param>
    /// <param name="BitIndex"></param>
    public record UpdateRegValue(int RegIndex,int BitIndex ,int NewValue);

    /// <summary>
    /// I2C传输时钟速率设置的新值
    /// </summary>
    /// <param name="NewClockSpeed"></param>
    public record UpdateI2CClock(uint NewClockSpeed) { }

    /// <summary>
    /// 实时速度曲线的点的鼠标捕捉开启和关闭
    /// </summary>
    /// <param name="Open"></param>
    public record SpeedPlotPointCatch(bool Open) { }
}
